<?php 
// -----------------------------------------------------------------------------
// sdefastsearch - A PHP Fast ESP Search API
// Copyright (C) 2008,2009 sueddeutsche.de GmbH, Hultschiner Str. 8, D-81677 München
// www.sueddeutsche.de.de - Andreas.Scheerer@sueddeutsche.de
//
// This file is part of sdefastsearch.
//
// sdefastsearch is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
// -----------------------------------------------------------------------------

/**
 * @author  Andreas Scheerer <Andreas.Scheerer@sueddeutsche.de>
 * @version $Id: resultlist.tpl.php 11 2009-08-23 04:23:33Z andreas.scheerer $ 
 */

?>
<div id="resultlist">
    
<?php if ($templData['documentsIter']->count() < 1)  { ?>
    <div id="emptyresultset">
        no documents found.
    </div>    
<?php } else { ?>
    <div id="resultset">
        <?php echo $templData['totalHits']?> matching documents found<br><br>
        <hr>
        <?php while ($templData['documentsIter']->valid()) { ?>
            <div id="document">
                              
                #<?php echo $templData['documentsIter']->current()->getDocNo();?>
                [<?php echo $templData['documentsIter']->current()
                    ->getSummaryFieldByName('collection')->getStringValue()?>]
                <span class="title"><?php 
                    echo str_replace(array('<key>','</key>','<sep/>'),
                        array('<span class="key">','</span>','...'),
                        $templData['documentsIter']->current()
                            ->getSummaryFieldByName('title')->getStringValue())?></span><br>
                <?php echo str_replace(array('<key>','</key>','<sep/>'),array('<span class="key">','</span>','...'),
                    $templData['documentsIter']->current()
                        ->getSummaryFieldByName('body')->getStringValue())?><br>
                Location: <a href="<?php echo $templData['documentsIter']->current()
                    ->getSummaryFieldByName('url')->getStringValue()?>" target="_blank">
                    <?php echo $templData['documentsIter']->current()
                    ->getSummaryFieldByName('url')->getStringValue()?>
                    </a>
                <?php $templData['documentsIter']->next(); ?>
                <hr>
                <p/>
            </div>
        <?php } ?>    
    </div>
    <div id="paging">
        <?php if ($templData['showLastPaging']) {?>
            <a href="<?php echo $templData['baseGetURL']?>&page=<?php echo $templData['page']-1?>">last page</a>
        <?php } ?>
        page <?php echo $templData['page'] ?> of <?php echo $templData['numPages'] ?> 
        <?php if ($templData['showNextPaging']) {?>
            <a href="<?php echo $templData['baseGetURL']?>&page=<?php echo $templData['page']+1?>">next page</a>
        <?php } ?>
    </div>
<?php } ?>

</div>
